assume cs:code
code segment

    start:mov ah, 0
          int 16h

          call set_color

          mov ax, 4c00h
          int 21h

 set_color:mov ah, 1
           cmp al, 'r'
           je red
           cmp al, 'g'
           je green
           cmp al, 'b'
           je blue
           jmp set_color_ret
           
     red:shl ah, 1
     green:shl ah, 1
     blue: mov bx, 0b800h
           mov es, bx
           mov bx, 1
           mov cx, 2000
        s: and byte ptr es:[bx], 11111000B
           or es:[bx], ah
           add bx, 2
           loop s

  set_color_ret: ret

code ends
end start
